package com.java110.acct.payment.adapt.fuiou;

public class FuiouHttpUtil {
////
//
//    public static String postForm(String url, Map<String, String> paramMap) {
//        try {
//            System.out.println("HttpUtil.postForm调用开始,url==" + url + ",参数=="+ paramMap);
//            Request request = Request.Post(url);
//            request.addHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
//            Form form = Form.form();
//            for (String key : paramMap.keySet()) {
//                form.add(key, paramMap.get(key));
//            }
//            Response response = request.bodyForm(form.build(),Charset.forName("UTF-8")).execute();
//            if (response != null) {
//                Content content = response.returnContent();
//                System.out.println("HttpUtil.postForm调用返回结果=="+ content.asString());
//                return content.asString();
//            }
//        } catch (IOException e) {
//            e.printStackTrace();
//        }
//        return "";
//    }
//
//    public static String postJson(String url, String json) {
//        try {
//            System.out.println("HttpUtil.postJson调用开始,url==" + url + ",参数=="+ json);
//            Request request = Request.Post(url);
//            request.addHeader("Content-Type","application/json");
//            Response response = request.bodyString(json,ContentType.APPLICATION_JSON).execute();
//            if (response != null) {
//                Content content = response.returnContent();
//                System.out.println("HttpUtil.postJson调用返回结果=="+ content.asString());
//                return content.asString();
//            }
//        } catch (IOException e) {
//            e.printStackTrace();
//        }
//        return "";
//    }
}